<div class="fbneirong">
    <form class="am-form jdtask">


        <div class="am-form-group am-cf">
            <div class="zuo">商品链接：</div>
            <input type="hidden" name="id" value="<?php echo $id ?>">
            <div class="you">
                <input type="text" class="myinput am-input-sm" name="link" value="<?php echo $link; ?>"
                       placeholder="请输入链接">
            </div>
            <!--  <div    id="bufa" class="am-btn am-btn-secondary am-radius">再次发布</div>-->
        </div>
        <div class="am-form-group am-cf">
            <div class="zuo">店铺名：</div>
            <div class="you">
                 <input type="text" name="shop_name" class="myinput am-input-sm shop_name" id="doc-ipt-email-1"
                       value="<?php echo $shop_name; ?>" placeholder="请输入商品名称">


           <!--     <select class="myinput shop_name" style="width: 330px;border-radius: 5px;">
                    <?php /*foreach ($shoplist as $id => $v) { */?>
                        <option
                            <?php /*if ($shop_name == $v['name']) {
                                echo 'selected ';
                            } */?>
                        ><?php /*echo $v['name'] */?></option>
                    <?php /*} */?>
                </select>-->
            </div>
        </div>

        <div class="am-form-group am-cf">
            <div class="zuo">商品名称：</div>
            <div class="you">
                <input type="text" name="goods_name" class="myinput am-input-sm" id="doc-ipt-email-1"
                       value="<?php echo $goods_name; ?>" placeholder="请输入商品名称">
            </div>
        </div>


        <div class="am-form-group am-cf">
            <div class="zuo">页面显示价格：</div>
            <div class="zuo">
                <input type="text" name="price" class="myinput am-input-sm" id="doc-ipt-email-1"
                       value="<?php echo $price; ?>" placeholder="请输入客单价">
            </div>
            <div class="zuo">实际付款价格：</div>
            <div class="zuo">
                <input type="text" name="pay_price" class="myinput am-input-sm" id="doc-ipt-email-1"
                       value="<?php echo $pay_price; ?>" placeholder="请输入付款价格">
            </div>
        </div>

        <div class="am-form-group am-cf">

            <!--    <div class="zuo">开团价格：</div>
            <div class="zuo">
                <input type="text" name="single_price" class="myinput am-input-sm" value="<?php /*echo $single_price; */ ?>"
                       id="doc-ipt-email-1" placeholder="请输入开团价格">
            </div>

            <div class="zuo">拼团价格：</div>
            <div class="zuo">
                <input type="text" name="group_price" class="myinput am-input-sm" value="<?php /*echo $group_price; */ ?>"
                       id="doc-ipt-email-1" placeholder="请输入拼团价格">
            </div>-->


            <div class="zuo">搜索关键字：</div>
            <div class="zuo">
                <input type="text" name="keyword" class="myinput am-input-sm" id="doc-ipt-email-1" placeholder="请输入关键字"
                       value="<?php echo $keyword; ?>" style="width: 400px;">
            </div>

        </div>


        <div class="am-form-group am-cf">


            <div class="zuo">任务单量：</div>
            <div class="zuo">
                <input type="text" name="number" class="myinput am-input-sm" id="doc-ipt-email-1"
                       value="<?php echo $number; ?>" placeholder="请输入任务单量">
            </div>

            <div class="zuo">每单数量：</div>
            <div class="zuo">
                <input type="text" name="each_single" class="myinput am-input-sm" id="doc-ipt-email-1"
                       value="<?php echo $each_single; ?>" placeholder="请输入每单数量">
            </div>


        </div>


        <div class="am-form-group am-cf">
            <div class="zuo">订单类型：</div>
            <div class="you" style="margin-top: 4px;">
                <label class="am-radio-inline">
                    <input type="radio" value="1" <?php if ($type_h == 1) {
                        echo 'checked ';
                    } ?> name="type_h"> 普通单
                </label>
                <label class="am-radio-inline">
                    <input type="radio" value="2" <?php if ($type_h == 2) {
                        echo 'checked ';
                    } ?>name="type_h"> 高留评单
                </label>
                <label class="am-radio-inline">
                    <input type="radio" value="3" <?php if ($type_h == 3) {
                        echo 'checked ';
                    } ?>name="type_h"> DSR
                </label>
                <label class="am-radio-inline">
                    <input type="radio" value="4" <?php if ($type_h == 4) {
                        echo 'checked ';
                    } ?>name="type_h"> 拼多多直播间
                </label>

            </div>
        </div>

        <div class="am-form-group am-cf showpicbox" style="display: none">
            <div class="zuo">晒图上传：</div>
            <div class="zuo" style="height: 45px; width: 250px">
                <a href="javascript:" class="file" style="left: -22px ;bottom: 0">上传压缩包（每单1金币服务费）
                    <input type="file" name="uploadFile" class="uploadPicButton2" id="upload_file2">
                </a>
            </div>
            <div class="zuo showpicnum" style="color: red;width:auto;">请将图片打包上传(仅支持rar,zip格式 最大20m
                所有图片放在一个文件夹下,每单限1张晒图)
            </div>
        </div>


        <div class="am-form-group am-cf showpicbox" style="display: none">

            <div class="zuo">指定评论：</div>
            <div class="zuo" style="height: 45px; width: 250px">
                <a href="javascript:" class="file" style="left: -20px ;bottom: 0">请上传评论（每单1金币服务费）
                    <input type="file" name="uploadFile" class="uploadPicButton3" id="upload_file3">
                </a>
            </div>
            <div class="zuo textnum" style="color: red;width:auto;">请将评论以文档格式上传评论数量对应单量（每行文字算一条评论，每条评论请写成一行），仅支持txt格式
            </div>
        </div>

        <div class="am-form-group am-cf">
            <div class="zuo">购买类型选择：</div>
            <div class="zuo" style="margin-top: 4px;width: auto">
                <label class="am-radio-inline">
                    <input type="radio" value="1" <?php if ($pay_type == 1) {
                        echo 'checked ';
                    } ?> name="pay_type"> 全部开团
                </label>
                <label class="am-radio-inline">
                    <input type="radio" value="2" <?php if ($pay_type == 2) {
                        echo 'checked ';
                    } ?>name="pay_type"> 单独购买
                </label>
                <label class="am-radio-inline">
                    <input type="radio" value="3" <?php if ($pay_type == 3) {
                        echo 'checked ';
                    } ?>name="pay_type"> 优先参团
                </label>
                <!-- <div class="zuo">SKU：</div>
                 <div class="zuo">
                     <input type="text"   name="sku" class="myinput am-input-sm" id="doc-ipt-email-1" placeholder="请输入SKU">
                 </div>-->

            </div>

            <div class="zuo">定时发布：</div>
            <div class="zuo">
                <input type="text" value="<?php echo $releasetime ? date('Y-m-d H:i:s', $releasetime) : ""; ?> "
                       name="timing" class="myinput am-input-sm datapick1" style="width: 180px" id="doc-ipt-email-1"
                       placeholder="定时发布时间">
            </div>
        </div>


        <div class="am-form-group am-cf gexing">
            <div class="zuo">账户选择：</div>
            <div class="zuo" style="margin-top: 4px;width: auto">
                <label class="am-radio-inline">
                    <input type="radio" value="0" name="sex" <?php if ($sex == 0) {
                        echo 'checked ';
                    } ?> >男女随意(免费)
                </label>
                <label class="am-radio-inline">
                    <input type="radio" value="1" name="sex" <?php if ($sex == 1) {
                        echo 'checked ';
                    } ?>> 男号(1金币)
                </label>
                <label class="am-radio-inline">
                    <input type="radio" value="2" name="sex" <?php if ($sex == 2) {
                        echo 'checked ';
                    } ?>> 女号(1金币)
                </label>
            </div>


        </div>
        <div class="am-form-group am-cf gexing">
            <div class="zuo">个性设置：</div>
            <div class="you">
                <div class="zuo" style="width: 720px">
                    <label class="am-checkbox-inline">
                        <input type="checkbox" name="chat" <?php if ($chat == 1) {
                            echo 'checked ';
                        } ?> >假聊(2金币)
                    </label>
                    <label class="am-checkbox-inline">
                        <input type="checkbox" name="compare" <?php if ($compare == 1) {
                            echo 'checked ';
                        } ?>>货比三家(1金币)
                    </label>
                    <label class="am-checkbox-inline">
                        <input type="checkbox" name="collection" <?php if ($collection == 1) {
                            echo 'checked ';
                        } ?> >收藏商品收藏店铺(2金币)
                    </label>
                    <label class="am-checkbox-inline hostlog">
                        <input type="checkbox" name="sign" <?php if ($sign == 1) {
                            echo 'checked ';
                        } ?>>签收(1金币)
                    </label>
                    <label class="am-checkbox-inline hostlog" style="display: none">
                        <input type="checkbox" name="overnight" <?php if ($overnight == 1) {
                            echo 'checked ';
                        } ?> >隔夜收藏(2金币)
                    </label>
                    <label class="am-checkbox-inline ">
                        <input type="checkbox" name="night" <?php if ($night == 1) {
                            echo 'checked ';
                        } ?> >凌晨单(2金币)
                    </label>
                    <label class="am-checkbox-inline ">
                        <input type="checkbox" name="dianzan" <?php if ($dianzan == 1) {
                            echo 'checked ';
                        } ?> >评论点赞(0.5金币)
                    </label>
                </div>
            </div>
        </div>


        <div class="am-form-group am-cf">

            <div class="zuo">物流代发</div>
            <div class="you" style="margin-top: 4px">
                <label class="am-radio-inline">
                    <input type="radio" value="0" checked name="daifa">不代发
                </label>
                <label class="am-radio-inline">
                    <input type="radio" value="1" name="daifa"> 代发
                </label>
            </div>
        </div>


        <div class="am-form-group am-cf">
            <div class="zuo">备注说明：</div>
            <div class="you">
                <input type="text" name="remarks" class="myinput am-input-sm" id="doc-ipt-email-1"
                       value="<?php echo $remarks; ?>" placeholder="请输入备注">
            </div>
        </div>

        <div class="am-form-group am-cf">
            <div class="zuo">SKU：</div>
            <div class="you">
                <input type="text" name="sku" class="myinput am-input-sm" id="doc-ipt-email-1"
                       value="<?php echo $sku; ?>" placeholder="请输入SKU">
            </div>
        </div>

        <div class="am-form-group am-cf">
            <div class="zuo">主图上传：</div>
            <div class="you" style="height: 45px;">
                <div class="picbox" style="">
                    <img src="<?php echo base_url(); ?>/public/assets/image/wsc.png" class="picshow" style=" ">
                </div>
                <a href="javascript:" class="file">上传图片
                    <input type="file" name="uploadFile" class="uploadPicButton" id="upload_file">
                </a>
            </div>
        </div>
        <div class="am-form-group am-cf  taskbottom" style="">
            <div class="moneybox" style=" ">
                <div class="zuo" style="">任务所需本金：<span class="needmoney">0</span></div>
                <div class="zuo" style="margin-left: 25px;">任务所需金币： 基础佣金:<span class="needgold red"
                                                                               style="margin-left: 5px">0</span>
                    服务费:<span class="needgold2 red" style="margin-left: 5px">0</span></div>

                <div id="fabu" class=" submit am-btn am-btn-secondary am-radius" style="margin-right: 0px;">发布任务</div>

            </div>
        </div>
    </form>


    <div class="gonggao" style="width: 600px;height: 650px;display: none">
        <img style="width: 100%;height: 100%" src="<?php echo $this->session->webinfo['weixin']; ?>">
    </div>


</div>

<script>
    var minnub = "<?php echo $min; ?>";
    var maxnub = "<?php echo $max; ?>";
    var is12 = "<?php echo $is12; ?>"; //确认现在是否是12点
    var type_h = "<?php echo $type_h; ?>";
    var ishostweb = "<?php echo $this->web_id == 1 ? 1 : 0; ?>";
    var webid= '<?php echo $this->web_id; ?>';
    if(webid=='26'){
        $(".daifabox").hide();
    }
    var showpicnum = 0; //高留评的
    var showpicpath = "";
    var textpath = "";
    var textnum = "";

    /* var shoplist = '<?php echo json_encode($shoplist); ?>';
    shoplist = JSON.parse(shoplist);
    if (shoplist.length == 0) {
        let index =layer.open({
            type: 1,
            title: '请完善信息后由客服确认信息后 即可发布任务',
            skin: 'layui-layer-rim', //加上边框
            area: [70, 60], //宽高
            btn: '确认',
            content: '<div style="width: 100%;text-align: center;font-size: 18px">请完善信息后发再布任务</div>',
            yes: function(index, layero){
                window.location.href = "<?php echo base_url() ?>" + '/business/confirm';
            },
            cancel: function (index, layero) {

            }
        });
    }
*/
    var taskinfo = {};
    if (localStorage['taskinfo']) {
        taskinfo = JSON.parse(localStorage['taskinfo']);
    }

    function settaskinfo() {
        localStorage['taskinfo'] = JSON.stringify(taskinfo);
    }

    if (ishostweb == "0") {
        $(".hostlog").hide()
    }

    if (type_h == 1) {
        $(".gexing").show()
    } else {
        $(".gexing").hide()
    }

    if (type_h == 2) {
        $(".showpicbox").show()
    } else {
        $(".showpicbox").hide()
    }

    $("input").attr("autocomplete", "off");
    $("input[name='number']").focus(function () {
        $(this).val("");
    });
    $("input[name='each_single']").focus(function () {
        $(this).val("");
    });

    var picurl = "<?php  echo $picurl ?>";
    var picpath = "";

    if (picurl != "") {
        $(".picshow").addClass("newpic");
        $(".picshow").attr("src", picurl)
    }


    $("input[name='price']").change(function () {
        var value = $(this).val();
        $("input[name='pay_price']").val(value);
        $("input[name='single_price']").val(value);
        $("input[name='group_price']").val(value);
    });

    $(".uploadPicButton").change(function () {
        var pic = $('#upload_file')[0].files[0];
        var fd = new FormData();
        fd.append('uploadFile', pic);
        var url = "<?php echo base_url(); ?>/Business/uppic";

        $.ajax({
            url: url,
            type: "post",
            dataType: "json",
            // Form数据
            data: fd,
            cache: false,
            contentType: false,
            processData: false,
            success: function (data) {
                if (data.code == 0) {
                    $(".picshow").attr("src", data.url);
                    $(".picshow").addClass("newpic");

                    $(".picshow").show();
                    $("input[name=pic]").val(data.url);
                    picpath = data.path;
                    return;
                }
                layer.msg(data.msg);
            }
        });
    });

    $(".uploadPicButton2").change(function () {
        var pic = $('#upload_file2')[0].files[0];
        var fd = new FormData();
        fd.append('uploadFile', pic);
        var url = "<?php echo base_url(); ?>/Business/uprar";
        showpicnum = 0;
        showpicpath = "";
        $(".showpicnum").text("图片上传中请耐心等待……");
        // $("input[name='number']").attr("readonly","false");
        on_request = true;
        $.ajax({
            url: url,
            type: "post",
            dataType: "json",
            // Form数据
            data: fd,
            cache: false,
            contentType: false,
            processData: false,
            success: function (data) {
                on_request = false;
                if (data.code == 0) {
                    showpicnum = data.num;
                    showpicpath = data.path;
                    $(".showpicnum").text("成功上传" + showpicnum + "张图片");
                    $(".showpicnum").show();
                    $("input[name='number']").val(showpicnum);
                    setgold();
                    // $("input[name='number']").attr("readonly","true");
                } else {
                    $(".showpicnum").text("请将图片打包上传(仅支持rar,zip格式 最大20m 所有图片放在一个文件夹下,每单限1张晒图)");
                }
                layer.msg(data.msg);
            }
        });
    });

    $(".uploadPicButton3").change(function () {
        var pic = $('#upload_file3')[0].files[0];
        var fd = new FormData();
        fd.append('uploadFile', pic);
        var url = "<?php echo base_url(); ?>/Business/uptext";
        textnum = 0;
        textpath = "";
        $(".showtextnum").text("(评论上传中请耐心等待，上传超过1分钟请刷新重试)");
        // $("input[name='number']").attr("readonly","false");
        on_request = true;
        $.ajax({
            url: url,
            type: "post",
            dataType: "json",
            // Form数据
            data: fd,
            cache: false,
            contentType: false,
            processData: false,
            success: function (data) {
                on_request = false;
                if (data.code == 0) {
                    textnum = data.num;
                    textpath = data.path;
                    taskinfo.textnum = textnum;
                    taskinfo.textpath = textpath;
                    settaskinfo();
                    $(".textnum").text("成功上传" + textnum + "条评论");
                    $(".textnum").show();
                    $("input[name='number']").val(textnum);
                    setgold();
                    // $("input[name='number']").attr("readonly","true");
                } else {
                    delete taskinfo.textnum;
                    delete taskinfo.textpath;
                    textnum = 0;
                    window.location.reload()
                    textpath = "";
                    settaskinfo();
                    $(".textnum").text("(评论上传中请耐心等待，上传超过1分钟请刷新重试)");
                }
                layer.msg(data.msg);
            }
        });
    });


    var on_request = false;
    var type = 1;
    var page = 1;

    $("#fabu").click(function () {
        fabu()
    });

    function fabu() {
        if (on_request) {
            return;
        }

        var url = "<?php echo base_url(); ?>/Business/SendPddTask";
        var postdata = {};
        var link = $("input[name='link']").val();
        var goods_name = $("input[name='goods_name']").val();
        var shop_name = $("input[name='shop_name']").val();

        shop_name = $(".shop_name").val();
        if (!shop_name) {
            layer.msg("缺少商铺名称");
            return;
        }

        var price = $("input[name='price']").val();
        var pay_price = $("input[name='pay_price']").val();

        var number = $("input[name='number']").val();
        var each_single = $("input[name='each_single']").val();
        var keyword = $("input[name='keyword']").val();
        //  var coupon=$("input[name='coupon']").val();
        var sku = $("input[name='sku']").val();
        var remarks = $("input[name='remarks']").val();
        var pay_type = $("input[name='pay_type']:checked").val();
        var single_price = $("input[name='single_price']").val();
        var group_price = $("input[name='group_price']").val();
        var type_h = $("input[name='type_h']:checked").val();

        let chat = $("input[name='chat']:checked").val();
        let compare = $("input[name='compare']:checked").val();
        let collection = $("input[name='collection']:checked").val();
        let sign = $("input[name='sign']:checked").val();
        let overnight = $("input[name='overnight']:checked").val();
        let sex = $("input[name='sex']:checked").val();
        let daifa = $("input[name='daifa']:checked").val();
        let dianzan = $("input[name='dianzan']:checked").val();
        let night = $("input[name='night']:checked").val();
        if (type_h == 3) {
            daifa = '0';
        }


        postdata['daifa'] = daifa;
        postdata['link'] = link;
        postdata['goods_name'] = goods_name;
        postdata['shop_name'] = shop_name;
        postdata['price'] = price;
        postdata['pay_price'] = pay_price;
        postdata['number'] = number;
        postdata['each_single'] = each_single;
        postdata['keyword'] = keyword;
        //  postdata['coupon'] = coupon;
        postdata['sku'] = sku;
        postdata['remarks'] = remarks;
        postdata['pay_type'] = pay_type;
        postdata['single_price'] = pay_price;
        postdata['group_price'] = pay_price;
        postdata['type_h'] = type_h;

        if (type_h == 1) {
            postdata['chat'] = chat ? 1 : 0;
            postdata['compare'] = compare ? 1 : 0;
            postdata['collection'] = collection ? 1 : 0;
            postdata['sign'] = sign ? 1 : 0;
            postdata['overnight'] = overnight ? 1 : 0;
            postdata['sex'] = sex;
            postdata['night'] = night ? 1 : 0;
            postdata['dianzan'] = dianzan ? 1 : 0;
        }


        postdata['releasetime'] = $(".datapick1").val();
        if (!postdata['releasetime'] && postdata['night']) {
            layer.msg("凌晨单只能提前定时发布");
            return;
        }

        if (is12 == "1" && type_h == 2) {
            layer.msg("超过18点不能发布高留评单");
            return;
        }


        if (pay_type == undefined) {
            layer.msg("缺少开团信息");
            return;
        }

        if (type_h == undefined) {
            layer.msg("缺少订单类型");
            return;
        }


        var alldata = 1;
        var valuekey = '';
        let keylist = ['coupon', 'remarks', 'keyword', 'sku', 'releasetime', 'chat', 'compare', 'collection', 'sign', 'overnight', 'sex', 'dianzan', 'night']//这些参数不需必传
        $.each(postdata, function (key, value) {
            if ((!value) && $.inArray(key, keylist) == -1) {


                valuekey = key;
                alldata = 0;
                return false;
            }
        });
        if (!alldata) {
            layer.msg("缺少参数");
            $("input[name='" + valuekey + "']").focus();
            on_request = false;
            return;
        }
        postdata['pic'] = picpath;
        postdata['picurl'] = picurl;
        if (number > 10 && type_h == 1) {
            var result = confirm("单量超过10 请确认是否正确");
            if (!result) {
                return;
            }
        }
        if (each_single > 10 && type_h == 1) {
            var result = confirm("每单数量超过10 请确认是否正确");
            if (!result) {
                return;
            }
        }

        if (number * 1 < minnub * 1 && type_h == 2) {
            layer.msg("高留评单单量必须在10-500之间", {icon: 5, time: 800});
            return;
        }

        if (type_h == 3 && (number !=6)) {
            layer.msg("DSR单量必须是6单");
            return;
        }
        if (number * 1 > maxnub * 1 && type_h == 2) {
            layer.msg("高留评单单量必须在10-500之间", {icon: 5, time: 800});
            return;
        }
        if (type_h == 2 && (number * 1 > showpicnum * 1) && showpicpath != "") {
            layer.msg("单量大于上传的晒图数量");
            return;
        }

        if (type_h == 2 && showpicpath != "") {
            postdata['showpicpath'] = showpicpath
        }
        if (type_h == 2 && textnum != "") {
            postdata['textpath'] = textpath
            postdata['textnum'] = textnum
        }
        fabupost(url, postdata);
    }

    function fabupost(url, postdata) {
        on_request = true;
        $.post(url, postdata, function (data) {
            on_request = false;
            if (data.code == 0) {
                layer.msg("任务发布成功")
                window.location.href = "<?php echo base_url() ?>" + '/business/pddtasklist';
            } else {
                layer.msg(data.msg)
            }
        }, "json");
    }

    $("input[name='each_single']").bind("change", setgold);
    $("input[name='pay_price']").bind("change", setgold);
    $("input[name='number']").bind("change", setgold);
    $("input[name='type_h']").bind("change", setgold);

    $("input[name='chat']").bind("change", setgold);
    $("input[name='compare']").bind("change", setgold);
    $("input[name='collection']").bind("change", setgold);
    $("input[name='sign']").bind("change", setgold);
    $("input[name='overnight']").bind("change", setgold);
    $("input[name='sex']").bind("change", setgold);
    $("input[name='night']").bind("change", setgold);
    $("input[name='dianzan']").bind("change", setgold);


    setgold();

    function setgold() {


        on_request = false;

        var price = $("input[name='pay_price']").val();
        var number = $("input[name='number']").val();
        var each_single = $("input[name='each_single']").val();

        var type_h = $("input[name='type_h']:checked").val();
        if (type_h == 1) {
            $(".gexing").show()
        } else {
            $(".gexing").hide()
        }
        if (type_h == 2) {
            $(".showpicbox").show()
        } else {
            $(".showpicbox").hide()
        }

        let chat = $("input[name='chat']:checked").val();
        let compare = $("input[name='compare']:checked").val();
        let collection = $("input[name='collection']:checked").val();
        let sign = $("input[name='sign']:checked").val();
        let overnight = $("input[name='overnight']:checked").val();
        let sex = $("input[name='sex']:checked").val();
        let daifa = $("input[name='daifa']:checked").val();
        let dianzan = $("input[name='dianzan']:checked").val();
        let night = $("input[name='night']:checked").val();
        if (type_h == 3) {
            daifa = 0;
        }


        var needmoney = price * each_single;

        if (needmoney <= 0 || type_h == undefined) {
            return;
        }
        $(".needmoney").text(needmoney * number);
        var url = "<?php echo base_url(); ?>/Business/getgoldbymoney/2/" + type_h;
        var postdata = {};
        needmoney = formatterNumber(needmoney);
        postdata['needmoney'] = needmoney;

        let base = 1;

        if (type_h == 1) {
            if (chat) {
                base = base + 2;
            }
            if (compare) {
                base = base + 1;
            }
            if (collection) {
                base = base + 2;
            }
            if (sign) {
                base = base + 1;
            }
            if (overnight) {
                base = base + 2;
            }
            if (sex * 1 > 0) {
                base = base + 1;
            }
            if (night) {
                base = base + 2;
            }
            if (dianzan) {
                base = base + 0.5;
            }
        }
        if (type_h == 2 && showpicnum * 1 > 0) {
            base = base + 1;
        }
        if (type_h == 2 && textnum * 1 > 0) {
            base = base + 1;
        }
        if (daifa * 1 > 0) {
            base = base + 1.1;
        }

        $.post(url, postdata, function (data) {
            on_request = false;
            number = number * 1;
            data.allgold = data.allgold * number;
            data.allgold = data.allgold - number;
            data.allgold = data.allgold.toFixed(1);
            $(".needgold").text(data.allgold);
            $(".needgold2").text((number * base).toFixed(1));
        }, "json");

    }


    laydate.render({
        elem: '.datapick1',
        type: 'datetime'
    });


</script>


<!-- 底部模板-->
</div>
</div>
</div>


</body>
</html>
<!-- 底部模板-->